Basic Structure of an HTML Document

An HTML document is divided into two parts: the head and the body. This document contains different tags and every tag is enclosed with start and end tag of the HTML element. For example, the <head> tag is termed as the start tag and </head> is termed as the end tag.

The basic structure of the HTML document is given below:


<!DOCTYPE html>
<html>
<head>
<title>
Title of the web page
</title>
</head>
<body>
Contents of the web page
</body>
</html> 

You can notice above that an HTML document formally begins with the <! DOCTYPE html> element. All your HTML code resides between the <html> and </html> tags. The <html> element has two elements inside it: <head> and <body>. The <head> element is used to specify information about the HTML Web page, such as title of the Web page and Meta tags also in this section mention; whereas, actual contents of the Web page are specified inside the <body> element.

Let’s now learn about the element present in the preceding syntax, one by one: click next button: